home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
tex
/
rtextu10.zip
/
MCOL.DOC
< prev
next >
Wrap
Text File
|
1993-05-06
|
10KB
|
212 lines
# # #####
## ## # # #### #
# # # # # # # #
# # # # # # #
# # # # # #
# # # # # # #
# # ##### #### ######
You can get part of the following documentation by invoking the program with
the switches -v, -h, or -H . See README.TXT for more information.
----------------------------------- -v ------------------------------------
MCOL v1.0 -- Arrange text in multiple columns
Copr (c) 1992,1993 Richard Breuer. MCOL is freeware. No warranties.
This is MCOL/2 v1.0 - renamed to MCOL (from RUTILS 4).
Author: Richard Breuer
Brunssumstrasse 6
5100 Aachen
(after Jul 1, 1993: 52074 Aachen)
Germany
Europe
Phone: +49/241/85605
Fax: +49/241/8021329
Email: ricki@pool.informatik.rwth-aachen.de (Preferred!)
----------------------------------- -h ------------------------------------
MCOL v1.0 -- Arrange text in multiple columns
Copr (c) 1992,1993 Richard Breuer. MCOL is freeware. No warranties.
Usage:
MCOL [-c:f:hHl:s:tv*] infile.. [{>|>>} outfile]
Options (-c and -f are mutually exclusive):
-c<c> Arrange text in c columns (default is c=2)
-f<f> Define the line layout. See "Format" below for details
-h Display this help screen
-H Display another help screen with notes and examples
-l<l> Set page length (default is l=66; l must be <= 128)
-s<s> Set page separator string (default is s=!12, ie. ^L=form feed)
-t Truncate lines, which are too long (default is: wrap lines)
-v Display version info and information about the author
-* Display internal information (for debugging purposes)
Format:
The -f<f> option gives you a powerful possibility to define the line layout.
You can specify text constant in s as well as ranges where the input text is
placed. Consider the call MCOL -f'@20 - @20', which defines two regions
of 20 characters each for the input text (the @ serves as a metacharacter)
which are separated with the three characters ' - '.
----------------------------------- -H ------------------------------------
MCOL v1.0 -- Arrange text in multiple columns
Copr (c) 1992,1993 Richard Breuer. MCOL is freeware. No warranties.
Notes:
MCOL reads from stdin if a filename is -. The output is always directed
to stdout. The line lengths are restricted to 255 characters. Longer lines
will be cut. The errorlevel is set to 1 if help has been displayed. It is
set to 255 in case of an error and 0 on normal completion. Output resulting
from multiple input files is appended to stdout. The processing order for
wildcards depends on the order of the directory entries. MCOL returns
nonsense for binary files.
The standard format is computed as follows: the line width is set to 78. The
columns are separated by 2 blanks. The remaining space is equally used for
the column texts.
Examples:
MCOL LYRICS.TXT
Formats LYRICS.TXT in 2 columns. Long lines will be wrapped.
MCOL -f'#@80 @80' TEST.IN > TEST.OUT
Inserts a '#' at the beginning of every line of TEST.IN and writes the
result in two columns to TEST.OUT. Note that the resulting output line
length is 1+80+2+80=163 characters.
-------------------------------------------------------------------------------
Additional information:
I wrote MCOL to help me formatting files containing lyrics. These files
are often less than 40 characters wide. I wanted to re-format them into
two columned text (if you have ever done this by hand, you know what
clumsy means :-) ). MCOL makes this task an easy one:
MCOL input.fil > output.fil
and you have a two-columned text file.
There are several options to control MCOLs behaviour, ie. the number of
columns, page separators, and the powerful -f option (see above).
Speaking of page separators. Since version 4 of RUTILS you can pass
arbitrary binary characters to the programs. This proves very useful for
MCOL, because you can eg. pass a header string to it which will appear
on top of every page but the first one:
MCOL input.fil -s!12'This is a header string'!13!10 > output.fil
where the meaning of the character codes is
!12 form feed; tells the printer to eject the current page
!13 carriage return..
!10 ..line feed are DOS's way to terminate a line in a text file
Analogously you can specify a footer string which will appear on the
bottom of each page but the last one:
MCOL input.fil -s'This is a footer string'!12 > output.fil
These examples also give you a good impression of the behaviour of the
command line parser I wrote.
Examples:
Let's consider the following input file FOO.DAT
>I'm a little piece of code<
>Master Ricki did me wrote<
>This rhyme is English bad in style<
>and nothing but a testing file.<
>Although I might be just some shit<
>for testing MCOL I do fit.<
> Ricki<
Here's the result of several MCOL calls with various parameters:
MCOL FOO.DAT -l4
----------------
>I'm a little piece of code Although I might be just some shit<
>Master Ricki did me wrote for testing MCOL I do fit.<
>This rhyme is English bad in style Ricki<
>and nothing but a testing file.
The page length was set to 4 to illustrate the multicolumn formatting
(otherwise everything would have been placed in one large column). We will
now introduce the -f option, which gives us a good possibility to illustrate
MCOLs features.
The format of the argument of -f is an arbitrary text string. In this string
the characater @ plays the role of a meta character. If it is followed by a
number, eg. @40, this is interpreted as a position, where 40 characters of
the input text may be placed. The format defined here is applied to every
line of the input text. It's much easier to illustrate this with our example:
MCOL -f'... @15 --- @15 ...' -l4 FOO.DAT
------------------------------------------------
... I'm a little pi --- This rhyme is E ...
... ece of code --- nglish bad in s ...
... Master Ricki di --- tyle ...
... d me wrote --- and nothing but ...
^L... a testing file --- shit ...
... . --- for testing MCO ...
... Although I migh --- L I do fit. ...
... t be just some --- ...
^L... R --- ...
... icki --- ...
The result is: two columns (because two @15 appear in the -f argument) with
a width of 15 characters each. The text lines which do not fit in one
column, are split and the rest is put in the next line. The text constants
"... ", " --- ", and " ..." are copied in each line. Again, we set
the page length to 4 lines. Therefore, the result consists of 3 pages which
are separated by ^L (default, because ^L is the form feed control code of
the most printers). You may change this separator to any other character or
string, eg.
MCOL FOO.DAT -l3 -s'-- This is a different separator --'!13!10
--------------------------------------------------------------
I'm a little piece of code This rhyme is English bad in style
Master Ricki did me wrote and nothing but a testing file.
-- This is a different separator --
Although I might be just some shit Ricki
for testing MCOL I do fit.
In this case a whole string is used as sep